<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
        >

    <p:dialog header="Adauga/Editeaza cetatenie" widgetVar="add_citizen_WV" dynamic="true"
              minHeight="300" width="600" modal="true" closeOnEscape="true">

        <h:form id="create_citizen_form">

            <h:panelGrid columns="2" columnClasses="column-1, column-200" styleClass="form-elements">

                <p:outputLabel for="citizen" value="Cetatenie:"/>
                <p:selectOneMenu id="citizen" value="#{additionalDataBean.selectedCitizen.citizenship}" required="true" style="width: 200px;"
                                 converter="#{objectMappingConverter}">
                    <f:selectItem itemLabel="Selectati ..."/>
                    <f:selectItems var="c" value="#{additionalDataBean.citizenShips}"
                                   itemLabel="#{c.name}" itemValue="#{c}"/>
                </p:selectOneMenu>
            </h:panelGrid>

            <p:outputPanel layout="block" style="border-top: 1px solid #A8A8A8; padding: 5px;">
                <p:commandButton icon="ui-icon-disk" value="Salveaza"
                                 update="@form :folder_details_content:folder_details_content:citizens_form"
                                 actionListener="#{additionalDataBean.saveCitizen}"
                                 oncomplete="if (args &amp;&amp; !args.validationFailed) add_citizen_WV.hide()"/>
                <p:commandButton value="Renunta" onclick="PF('add_citizen_WV').hide();" process="@none"/>
            </p:outputPanel>
        </h:form>
    </p:dialog>


</ui:composition>
